using SqlSugar;
using StudyCompanion.Core.Models;

namespace StudyCompanion.Entity.User;

/// <summary>
///     1.3 用户钱包日志
/// </summary>
[SugarTable("use_wallet_log")]
public class UseWalletLogEntity : BaseEntity
{
    /// <summary>
    ///     用户ID(use_user.Id)
    /// </summary>
    public long UserId { get; set; }
    
    /// <summary>
    ///     订单ID(ord_order.Id)
    /// </summary>
    public long? OrderId { get; set; }
    
    /// <summary>
    ///     钱包操作
    ///     1、订单支付
    ///     2、返佣
    ///     3、返佣
    ///     4、后台调整
    /// </summary>
    public int Action { get; set; }
    
    /// <summary>
    ///     操作状态
    ///     -1、处理失败
    ///     0：处理中
    ///     1：处理成功
    /// </summary>
    public int State { get; set; }
    
    /// <summary>
    ///     操作类型
    ///     1：增加
    ///     -1：减少
    /// </summary>
    public int Type { get; set; }
    
    /// <summary>
    /// 变化数量
    /// </summary>
    public decimal ChangeCount { get; set; }
    
    /// <summary>
    /// 变化前数量
    /// </summary>
    public decimal ChangeFrontCount { get; set; }
    
    /// <summary>
    /// 变化后数量
    /// </summary>
    public decimal ChangeLaterCount { get; set; }
    
    /// <summary>
    /// 描述
    /// </summary>
    public string? Describe { get; set; }
    
    /// <summary>
    /// 创建时间
    /// </summary>
    [SugarColumn(IsOnlyIgnoreInsert = true)]
    public DateTime Time { get; set; }
    
    /// <summary>
    /// 关联数据ID
    /// </summary>
    public long? TableId { get; set; }
}